<?php

  if(!isEmptyArr($_POST) && $_POST['task'] == 'subscribe')
  {
    unset($_POST['task']);
    userSubscribe($_POST, $Errors);
    foreach($Errors as $n => $val)
    {
      showMessageAlertJVSC($ERRORS['newsletter'][$val]);
    }
    go_toJVSC(getSameUri());
    exit;
  }
  if(!isEmptyArr($_POST) && $_POST['task'] == 'unsubscribe')
  {
    unset($_POST['task']);
    userUnSubscribe($_POST, $Errors);
    foreach($Errors as $n => $val)
    {
      showMessageAlertJVSC($ERRORS['newsletter'][$val]);
    }
    go_toJVSC(getSameUri());
    exit;
  }

  $Article = getRowByFields($_SQL_TABLE['article'], array("id = '8'", "active = 'y'"));
  $Article['title'] = $Article['title'.__FLANG];
  $Article['body'] = $Article['body'.__FLANG];
  $tpl->assign("Article", $Article);


  $tpl->assign("MetaKeywords", $Article['meta_keywords'.__FLANG]);
  $tpl->assign("MetaDescription", $Article['meta_description'.__FLANG]);
  $tpl->assign("MetaTitle", $Article['meta_title'.__FLANG]);

  $tpl->assign("PageTitle", $language['newsletter']['newsletters']);

  $_BODY_SMARTY_TEMPLATE = $CONFIG['ModulesFolder']."module.newsletters.tpl";

?>